package com.jxt.mina.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.jxt.mina.server.Server;


/**
 * mina服务端监听器
 * @author Scott.Wong
 *
 */
public class ServerMinaListener implements ServletContextListener{
	
	private Server server;
	
	public void contextDestroyed(ServletContextEvent arg0) {
		server.stop();
	}

	public void contextInitialized(ServletContextEvent arg0) {
		server = new Server();
		server.start();	
	}

}
